package com.wang.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

@Aspect
@Configuration
@Order(300)// 相同的切入点，order小的最先执行
public class AopAspect2 {

    @Around(value = "execution(* com.wang.controller.*.*(..))")
    public Object around3(ProceedingJoinPoint joinPoint){
        try {
            System.out.println("AopAspect.around3 start");
            return joinPoint.proceed();
        }catch (Throwable throwable){
            System.out.println();

        }finally {
            System.out.println("AopAspect.around3 end");
        }
        return null;
    }

    @Around(value = "execution(* com.wang.controller.*.*(..))")
    public Object around2(ProceedingJoinPoint joinPoint){
        try {
            System.out.println("AopAspect.around2 start");
            return joinPoint.proceed();
        }catch (Throwable throwable){
            System.out.println();

        }finally {
            System.out.println("AopAspect.around2 end");
        }
        return null;
    }
}
